define(function (require) {


    function DragBox(dom) {
        this.dragBoxDom = dom;
        this.sceneDom = dom.getElementsByClassName("drag-box__scene")[0];
        this.containerDom = dom.getElementsByClassName("drag-box__container")[0];
    }
    DragBox.prototype = {
        show:function (txt) {
            this.containerDom.innerHTML = txt;
        },
        clear:function () {
            while (!(this.containerDom.firstChild.nodeType === 1 && this.containerDom.firstChild.classList.contains("drag-box__bottom-bar"))){
                this.containerDom.removeChild(this.containerDom.firstChild);
            }
            while (this.sceneDom.firstChild){
                this.sceneDom.removeChild(this.sceneDom.firstChild);
            }
        },
        add:function (_) {
            for (var i in arguments){
                this.containerDom.insertBefore(arguments[i],this.containerDom.lastChild)
            }
        },
        getContainerDom:function () {
            return this.containerDom;
        }
    }

    function Switcher(dom) {
        this.dom = dom;
        this.onDom = dom.querySelector(".switcher__on");
        this.offDom = dom.querySelector(".switcher__off");
    }
    Switcher.prototype = {
        toggle:function () {
            this.dom.classList.toggle("on");
        },
        turnOn:function () {
            this.dom.classList.add("on");
        },
        turnOff:function () {
            this.dom.classList.remove("on");
        },
        isOn:function () {
            return this.dom.classList.contains("on");
        }
    }

    return{
        DragBox:DragBox,
        Switcher:Switcher
    }
})